package com.maiji.cloud.service;

import com.maiji.cloud.entities.shopingmall.CapitalMainLog;
import com.maiji.cloud.request.BaseDataReqDto;
import com.maiji.cloud.request.ReqMetaData;
import com.maiji.cloud.request.shopingmall.*;
import com.maiji.cloud.request.shopingmall.PayResDto;
import com.maiji.cloud.response.BaseDataResDto;
import com.maiji.cloud.response.BaseMetaResDto;
import com.maiji.cloud.response.BaseResDto;
import com.maiji.cloud.response.BdXCXResDto;
import com.maiji.cloud.response.shopingmall.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.service.IService;

public interface CapitalMainLogService extends IService<CapitalMainLog> {

	/**
	 * 获取现金余额流水
	 * @param param
	 * @param maijiToken
	 * @return
	 */
	public FinancialDetailsResDto financialDetails(ReqMetaData param, String maijiToken);

	/**
	 * 获得积分流水
	 * @param param
	 * @param maijiToken
	 * @return
	 */
	public IntegralFlowResDto integralFlow(ReqMetaData param, String maijiToken);

	/**
	 * 获得流水记录
	 * @param param
	 * @param maijiToken
	 * @return
	 */
	public CapitalIOListResDto getcapitalIOList(BaseDataReqDto<CapitalIOListReqData> param, String maijiToken);

	/**
	 * 微信预支付
	 * @return
	 */
	public BaseDataResDto<Map<String,Object>> weixinPay(WeixinPayReqDto param,String maijiToken)throws Exception;

	/**
	 * 微信支付成功回调
	 * @param param
	 * @return
	 */
	public Map weixinPayCallBack(PayResDto param)throws Exception;

	/**
	 * 用户申请退款
	 * @param param
	 * @param maijiToken
	 * @return
	 */
	public BaseResDto userApplayRefund(UserApplayRefundReqDto param, String maijiToken);

	public Map refundCallBack(WXRefundReqDto param)throws Exception;
	
	/**
	 * 支付宝支付
	 * @param param
	 * @param maijiToken
	 * @return
	 */
	public BaseDataResDto<AliPayResData> alipay(WeixinPayReqDto param, String maijiToken)throws Exception;
	
	/**
	 * 支付宝支付成功回调
	 * @param param
	 * @return
	 */
	public Map<String, Object> alipayCallBack(Map<String,String> param)throws Exception;

    BaseMetaResDto<List<ShoppingOrderRefundResData>> findAllOrderRefunds(OrderRefundReqData data, ReqMetaData reqMetaData);

    BaseDataResDto<List<Map<Integer, Integer>>> findAllOrderRefundsTypeCount();

    BaseResDto confirmReceived(String orderRefundId, String orderId);

    /**
     * 客服审核退款申请
     * @return
     */
    BaseResDto agreeApplyRefund(OrderRefundReqData data);

    /**
     * 客服执行退款
     */
    BaseResDto executeRefund(String orderRefundId);

	/**
	 * 余额支付
	 * @param param
	 * @param maijiToken 
	 * @return
	 */
    public BaseDataResDto<String> balancePay(BaseDataReqDto<BalancePayReqData> param, String maijiToken);

	/**
	 * 微信小程序预支付
	 * @param param
	 * @param maijiToken
	 * @return
	 */
    public BaseDataResDto<Map<String, Object>> weixiAppletPay(WeixinPayReqDto param, String maijiToken)throws Exception;

    BaseResDto userCancelRefund(String orderId);

    BaseResDto withdrawOrderReturn(WithdrawReqData data, String maijiToken);

    BaseResDto withdrawDistribution(WithdrawReqData data, String maijiToken);

    /**
	 * 积分消费流水
	 * @param param
	 * @param maijiToken
	 * @return
	 */
    public IntegralFlowResDto integralConsumeFlow(ReqMetaData param, String maijiToken);

	/**
	 * 积分获得流水
	 * @param param
	 * @param maijiToken
	 * @return
	 */
    public IntegralFlowResDto integralGainFlow(BaseDataReqDto<IntegralGainFlowReqData> param, String maijiToken)throws Exception ;

    public BaseDataResDto<List<FinancialDetailsResData>> balanceConsumeFlow(ReqMetaData param, String maijiToken);

	/**
	 * 减肥基金使用明细
	 * @param param
	 * @param maijiToken
	 * @return
	 */
    public BaseDataResDto<List<FinancialDetailsResData>> reduceWeightFundConsumeFlow(ReqMetaData param, String maijiToken);

	/**
	 * 订单返现收入明细
	 * @param param
	 * @param maijiToken
	 * @return
	 */
    public BaseDataResDto<List<OrderReturnMoneyFlowResData>> getOrderReturnMoneyFlow(
			BaseDataReqDto<OrderReturnMoneyFlowReqData> param, String maijiToken);

	/**
	 * 获取任务列表
	 * @param maijiToken
	 * @return
	 */
    public BaseDataResDto<List<TaskListResData>> getTaskList(String maijiToken)throws Exception ;

    /**
	 * 查看是否绑定支付宝/微信 1：支付宝，2：微信
	 * @param maijiToken
	 * @return
	 */
    public BaseDataResDto<List<BindWinthdrawAccountResData>> isBindWinthdrawAccount(List<Integer> type, String maijiToken);

    BaseMetaResDto<List<CapitalMainLog>> findAllCapitalMainLogs(String userId, Integer capitalType, List<Date> changeDates, ReqMetaData metaData);

    BdXCXResDto<Map<String, Object>> bdXCXCallBack(Map<String, String> param);
    
}
